#include "mylabel.h"
#include <QFont>
#include <QDebug>

MyLabel::MyLabel(const QString &text, QWidget *parent)
    : QLabel(text, parent)
{

}

void MyLabel::wheelEvent(QWheelEvent *event)
{
    if(event->modifiers() == Qt::ControlModifier)
    {
        QFont font = this->font();
        if(event->delta() > 0)
        {
            qDebug() << event->delta();
            font.setPointSize(font.pointSize() + 1);
        }
        else if(event->delta() < 0)
        {
            qDebug() << event->delta();
            font.setPointSize(font.pointSize() - 1);
        }
        this->setFont(font);
    }
}
